<html>
<div id="myheader">
<?php
        include "include/top.php"
?>
</div>

<title>OSPMS</title>
<head>

<script type="text/javascript">
<!--
 function ExChgClsName(Obj,NameA,NameB){
  var Obj=document.getElementById(Obj)?document.getElementById(Obj):Obj;
  Obj.className=Obj.className==NameA?NameB:NameA;
 }
 function showMenu(iNo){
 ExChgClsName("Menu_"+iNo,"MenuBox","MenuBox2");
 }
-->
</script>
</head>

<body>
<div id="mymajorbody">
<div id="mybody">

<form method="post" action="<?php $_PHP_SELF ?>">
<table class="mytable regtable">
    <tr>
      <th></th>
      <th class="righttd">Upload File</th>

    </tr>
    <tr>
      <td class="lefttd">cust_id:</td>
      <td class="righttd"><input type="text" name="cust_id" class="text"/></td>
    </tr>
    <tr>
      <td class="lefttd">Input1:</td>
      <td class="righttd"><input type="text" name="Input1" class="text"/></td>
    </tr>
    <tr>
      <td class="lefttd">File:</td>
      <td class="righttd"><input type="file" name="Input_filename" id="filename" style="display:button"/></td>
<!--	<button  class="righttd" type="button" onclick="javascript:document.getElementById('myUpload').click();">Upload File</button>  -->
    </tr>
    <tr>
      <td class="lefttd">Input3:</td>
      <td class="righttd"><input type="text" name="Input3" class="text"/></td>
    </tr>
    <tr>
      <td></td>
      <td class="righttd">
        <input type="submit" value="Upload" name="add" id="cmdLogin"/>
      </td>
    </tr>
</table>
</form>


<?php
if(isset($_POST['add']))
{

$dbhost = 'localhost';
$dbuser = 'ospms';
$dbpass = 'stevepeng123';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
  die('Could not connect: ' . mysql_error());
}

$sql = "INSERT INTO customer_file_info".
       "(cust_id, file_name, file_location, revision ) ".
       "VALUES('$cust_id', '$Input1', '$Input2', '$Input3'";
echo "$sql";
echo "<br> </br>";
mysql_select_db('OSPMS');
$retval = mysql_query( $sql, $conn );

if(! $retval )
{
  mysql_close($conn);
  die('Could not enter data: ' . mysql_error());
}
else
{
echo "Entered data successfully\n";
}

}
?>






</div>
</div>














<div id="myfooter">
<?php
        include "include/bottom.php"
?>
</div>
